<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="Generator" content="ALORK 20150428.01" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="<?php echo $this->_var['keywords']; ?>" />
<meta name="Description" content="<?php echo $this->_var['description']; ?>" />

<title><?php echo $this->_var['page_title']; ?></title>

<?php if ($this->_var['cat_style']): ?>
<link href="<?php echo $this->_var['cat_style']; ?>" rel="stylesheet" type="text/css" />
<?php endif; ?>
<link rel="stylesheet" href="<?php echo $this->_var['ecs_css_my']; ?>" />
<link rel="stylesheet" href="<?php echo $this->_var['ecs_css_path']; ?>" />
<link rel="stylesheet" href="<?php echo $this->_var['__PUC__']; ?>css/common.css" />
    <?php echo $this->smarty_insert_scripts(array('files'=>'common.js')); ?>
</head>
<body >
	<?php echo $this->fetch('library/page_header.lbi'); ?>
	<div class="goods_top"></div>
	<div style="width: 100%;float: left;">
	<div id="goods" class="body" style="width: 1209px; border-top: none;padding: 0;">
	<div class="body" style="width: 100%;">
		<div id="magnifier_pic"><div class="magnifier_pic"><img src="images/defaultico.gif" class="loadimg loadbg" data-original="<?php echo $this->_var['pictures']['0']['img_original']; ?>"/></div></div>
		<div class="box_top" style="width: 1207px;border: 1px solid #ddd;border-top: 0;padding-top: 20px;">
    		<div class="photo">
    			<div class="big_img" >
    				<div class="magnifier"></div>
    				  <img src="images/defaultico.gif" class="loadimg" data-original="<?php echo $this->_var['pictures']['0']['img_url']; ?>" alt="<?php echo htmlspecialchars($this->_var['goods']['goods_name']); ?>"/>
    			</div>
    			<div class="thumb">
    			    <?php $_from = $this->_var['pictures']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'picture');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['picture']):
?>
    	            <a href="javascript:void();" target="_blank">
    					<?php if ($this->_var['key'] == 0): ?>
    	            	<span class="thumb_top thumb_top_b"></span>
    	            	<?php else: ?>
    	            	<span class="thumb_top"></span>
    					<?php endif; ?>
    	            	<img src="images/defaultico.gif" data-original="<?php if ($this->_var['picture']['thumb_url']): ?><?php echo $this->_var['picture']['thumb_url']; ?><?php else: ?><?php echo $this->_var['picture']['img_url']; ?><?php endif; ?>" big="<?php echo $this->_var['picture']['img_url']; ?>" original="<?php echo $this->_var['picture']['img_original']; ?>" alt="<?php echo $this->_var['goods']['goods_name']; ?>" class="B_blue loadimg" /></a>   
    	            <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    			</div>

    		</div>
    		<div class="info" style="width: 730px;">
    			<div class="clearfix title" style="width: 600px;padding-left: 30px;"><?php echo $this->_var['goods']['goods_name']; ?></div>
                <div class="clearfix" style="width: 600px;padding-left: 30px;border-bottom: 1px solid #ddd;height: auto;font-weight: normal;line-height: 20px;padding-bottom: 20px;padding-top: 10px;"><?php echo $this->_var['goods']['goods_brief']; ?></div>
                <div class="clearfix" style="width: 600px;padding-left: 30px;height: auto;font-weight: normal;padding-top: 10px;">市场价　<span style="text-decoration: line-through;"><?php echo $this->_var['goods']['market_price']; ?></span></div>
    	        <div class="clearfix" style="width: 600px;padding-left: 30px;height: auto;font-weight: normal;padding-top: 10px;">优惠价　<span style="color: #a60000;font-size: 29px;"><?php echo $this->_var['goods']['shop_price']; ?></span></div>
                <div class="clearfix" style="width: 600px;padding-left: 30px;height: auto;font-weight: normal;padding-top: 40px;padding-bottom: 40px;border-bottom: 1px solid #ddd;">
                    <a href="<?php echo $this->_var['goods']['get_url']; ?>" class="button_2" style="display: block;float: left;">立即前往购买</a><a href="javascript:collect(<?php echo $this->_var['goods']['goods_id']; ?>)" class="thumb_bttom" style="display: block;float: left;margin-left: 20px;height: 40px;line-height: 40px;">加入收藏</a>
                </div>
                <div class="clearfix" style="width: 600px;padding-left: 30px;height: auto;font-weight: normal;padding-top: 10px;">
                <?php $_from = $this->_var['catList']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['item']):
?>
                <a href="search.php?keywords=<?php echo $this->_var['item']['cat_name']; ?>" style="color: #666;padding: 3px 20px;background: #f0f0f0;margin: 5px 10px 5px 0;float: left;"><?php echo $this->_var['item']['cat_name']; ?></a>
                <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                </div>
    		</div>
		</div>
		<div class="more" style="margin-left: 0;margin-top: 20px;width: 212px;">
            <div class="box_1">
                <div class="top" style="border: 1px solid #ddd;padding: 0 10px;background: #fff;width: 190px;">历史浏览记录</div>
                <div class="boxCenterList clearfix" id='history_list' style="border: 1px solid #ddd;background: #fff;width: 190px;padding: 0 10px;margin-top: 10px;">
                    <?php 
$k = array (
  'name' => 'history',
);
echo $this->_echash . $k['name'] . '|' . serialize($k) . $this->_echash;
?>
                </div>
                <script type="text/javascript">
                function clear_history()
                {
                    Ajax.call('user.php', 'act=clear_history',clear_history_Response, 'GET', 'TEXT',1,1);
                }
                function clear_history_Response(res)
                {
                    document.getElementById('history_list').innerHTML = '<?php echo $this->_var['lang']['no_history']; ?>';
                }
                </script>
            </div>
		</div>
		<div class="main" style="width: 977px;margin-top: 20px;margin-right: 0px;position: relative;float: left;margin-left: 20px;">
            <style>
                #goods .main .nav{background: #fff;border: 1px solid #ddd;height: 40px;width: 975px;}
                #goods .main .nav li{background: #fff;}
                #goods .main .nav li.hover{background: #fff;border-bottom: 2px solid #8b040a;height: 39px;color: #666;}
            </style>
			<div class="nav" style="position: absolute;">
				<ul>
					<li onclick="javascript:window.location.href='#goods_desc'" class="hover">商品信息</li>
				</ul>
			</div>

			<div class="box1 box" style="margin-top: 41px;border: 1px solid #ddd;width: 975px;">
            <blockquote style="padding: 0;" class="blockquote">
                <style>
                    .blockquote p{margin: 0 auto;max-width: 870px;}
                    .blockquote img{margin: 0 auto;max-width: 870px;vertical-align: middle;font-size: 19px;display: block;}
                </style>
            </blockquote>
			<script type="text/javascript">
			var goods_desc = '<?php echo $this->_var['goods']['goods_desc']; ?>';
			$(function(){
				$('.box1 blockquote').append(goods_desc);
			});
			</script>
			</div>
		</div>

	</div>
 </div>
</div>
	<?php echo $this->fetch('common/page_footer.lbi'); ?>
	<?php echo $this->fetch('common/follow_right.lbi'); ?>

<script type="text/javascript">
// 商品图片变换
		$(function(){
			$("#goods .photo .thumb img").mouseenter(function(){
				$(this).parent().find(".thumb_top").addClass("thumb_top_b").parent().siblings().find(".thumb_top").removeClass('thumb_top_b');
				$("#goods .photo .big_img img").attr("src",$(this).attr("big"));
				$("#goods .body .none img").attr("src",$(this).attr("original"));
				$('#magnifier_pic .magnifier_pic img').attr("src",$(this).attr("original"));
				// $("#goods .body .magnifier_pic img").attr("src",$(this).attr("original"));
			});
		});
		// 放大镜JS
		$(document).ready(function(){
			$(".mores").toggle(
				function(){
				    $(".color_border").css("height","auto");
				    $(this).addClass("mores1");
				},
				    function(){
				    $(".color_border").css("height","125px");
				    $(this).removeClass("mores1");
				}
			);

	    var img=444;//定义区域大小
	 	var xOffset = 111;//定义x的偏移量
    	var yOffset = 111;//定义y的偏移量
		$("#goods .photo .big_img img").mouseenter(function(){
			var ran = 'pic'+Math.floor(Math.random()*10000+1);
			$("#goods .body").prepend('<div class="'+ran+'">'+$('#magnifier_pic').html()+'</div>');
			$("#goods .photo .big_img .magnifier").show();
			$("#goods .body ."+ran+" .magnifier_pic").animate({
    		height:'400px',
    		width:'400px',
    		marginTop:"27px",
    		marginRight:"250px",
    		opacity:'1'
  			});
			$("#goods .photo .big_img").mouseleave(function(){
				$("#goods .photo .big_img .magnifier").hide();
				$("#goods .body ."+ran+" .magnifier_pic").animate({
	    		height:'0px',
	    		width:'0px',
	    		opacity:'0',
	    		marginTop:"200px",
	    		marginRight:"800px"
	  			},300);
	  			setTimeout(function(){removes(ran)},600);
				// $("#goods .body .magnifier_pic").hide();
			});
		});
		function removes(ran){
			$("#goods .body ."+ran).remove();
		}

	$("#goods .photo .big_img").mousemove(function(e){
		$("#goods .photo .big_img").css({"position":"relative"});
		$("#goods .body").css({"position":"relative"});
	    var positionX=e.pageX-$(this).offset().left||e.originalEvent.layerX-$(this).offset().left||0;//获取当前鼠标相对img的x坐标
	    var positionY=e.pageY-$(this).offset().top||e.originalEvent.layerY-$(this).offset().top||0;
			if(yOffset>positionY<(img-yOffset)){
				$("#goods .photo .big_img .magnifier").css("top",(positionY-yOffset));
			}
			if(positionY<yOffset){
				$("#goods .photo .big_img .magnifier").css("top",0);
			}
			if(positionY>(img-yOffset)){
				$("#goods .photo .big_img .magnifier").css("top",(img-yOffset*2));
			}

			if(xOffset>positionX<(img-xOffset)){
				$("#goods .photo .big_img .magnifier").css("left",(positionX-xOffset));
			}
			if(positionX<xOffset){
				$("#goods .photo .big_img .magnifier").css("left",0);
			}
			if(positionX>(img-xOffset)){
				$("#goods .photo .big_img .magnifier").css("left",(img-xOffset*2));
			}
			var left=parseInt($("#goods .photo .big_img .magnifier").css('left'));
			var top=parseInt($("#goods .photo .big_img .magnifier").css('top'));
            $("#goods .body .magnifier_pic img").css("top",(-top*1.8)).css("left",(-left*1.8));
            if(top>268){
            	$("#goods .body .magnifier_pic img").css("top",(-268*1.8)).css("left",(-left*1.8));
            }
		});
	});

</script>
</body>



</html>